function* bar() {
  console.log("11");
  const result = yield new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve("hello generator");
    }, 3000);
  });
  console.log(result);
  yield console.log("ni hao");
  yield console.log("zhe shi");
}

const it = bar();
it.next().value.then((res) => {
  it.next(res);
});

// 需要好好看看了..
// it.next();
